package com.charonmc.commands;

import com.charonmc.parkour.ParkourManager;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;

public class BackCheckpoint implements CommandExecutor {
    @Override
    public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args){
        if (sender instanceof Player){
            Player player = (Player) sender;
            if (ParkourManager.parkourPlayers.containsKey(player)){
                player.teleport(ParkourManager.playerLocation.get(player));
            } else {
                player.sendMessage("§c§l您没有处于跑酷状态！");
            }
        }
        return true;
    }
}
